<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Document</title>
</head>
<body>
    
</body>
<script>
    var arr = [ 1, 1, 1, 2, 3, 1, 4, 1, 5, 6, 1 ];
    // 将 1 删除

    var index = -1;

    function indexOf( arr, elem ) {
        for ( var i = 0; i < arr.length; i++ ) {
            if ( arr[ i ] === elem ) {
                return  i;
            }
        }
        return -1;
    }


    while ( ( index = arr.indexOf( 1 ) ) != -1 ) {
        arr.splice( index, 1 );
    }

    console.log( arr );


</script>
</html>